package com.frxuexi.mdm2205

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.frxuexi.apps.AppsPage
import com.frxuexi.document.view.DocPage
import com.frxuexi.document.view.LocalPage
import com.frxuexi.user.view.MinePage
import com.frxuexi.lib_base.RoutePath
import com.frxuexi.mdm2205.view.HomePage
import com.frxuexi.mdm2205.view.MessagePage
import com.frxuexi.report.view.ReportCommitPage
import com.frxuexi.report.view.ReportPage
import com.frxuexi.sign.view.SignCommitPage
import com.frxuexi.sign.view.SignPage
import com.frxuexi.user.view.AddAprove
import com.frxuexi.user.view.AddEmployeePage
import com.frxuexi.user.view.ApproveListPage
import com.frxuexi.user.view.ApprovePage
import com.frxuexi.user.view.LoginPage
import com.frxuexi.user.view.RegisterPage
import com.frxuexi.user.view.SPPage

@Composable
fun MyNavHost(it:PaddingValues,navController:NavHostController) {
    NavHost(
        modifier = androidx.compose.ui.Modifier.padding(it),
        navController = navController,
        startDestination = RoutePath.HOME,
        builder = {
            composable(RoutePath.MESSAGE) { MessagePage() }
            composable(RoutePath.HOME) { HomePage(navController) }
            composable(RoutePath.MINE) { MinePage(navController) }
            composable(RoutePath.APPS) { AppsPage(navController) }
            composable(RoutePath.DOC) { DocPage(navController) }
            composable(RoutePath.LOCAL) { LocalPage(navController) }
            composable(RoutePath.REPORT) { ReportPage(navController) }
            composable(RoutePath.REPORTCOMMIT+"/{report}") {
                val report = it.arguments?.getString("report", "").toString()
                ReportCommitPage(navController,report) }
            composable(RoutePath.SIGN) { SignPage(navController) }
            composable(RoutePath.SIGNCOMMIT) { SignCommitPage(navController) }
            composable(RoutePath.REGISTER) { RegisterPage(navController) }
            composable(RoutePath.LOGIN) { LoginPage(navController) }
            composable(RoutePath.ADDEMP) { AddEmployeePage(navController) }
            composable(RoutePath.ADDAPPROVE) { AddAprove(navController) }
            composable(RoutePath.APPROVELIST) { ApproveListPage(navController) }
            composable(RoutePath.APPROVEDETAIL+"/{approve}") {
                val approve = it.arguments?.getString("approve", "").toString()
                ApprovePage(navController,approve) }
            composable(RoutePath.SP+"/{approve}") {
                val approve = it.arguments?.getString("approve", "").toString()
                SPPage(navController,approve) }
        })
}